#include <stdio.h>
#include "stack.h"
struct student
{
	int id;
	char name[40];
	int math;
};
int main()
{
	STACK * stack=stack_create(sizeof(struct student));
	int m=0;
	while(1)
	{
		printf("1、入栈\n");
		printf("2、出栈\n");
		printf("3、退出\n");
		scanf("%d",&m);
		if(m==1)
		{
			struct student s;
			printf("id=");
			scanf("%d",&s.id);
			printf("name=");
			scanf("%s",s.name);
			printf("math=");
			scanf("%d",&s.math);
			stack_push(stack,&s);
			
		}
		else if(m==2)
		{
			struct student s1;
			int x=stack_pop(stack,&s1);
			if(x==-1)
			{
				printf("栈空\n");
			}
			else
			{
				printf("id=%d\n",s1.id);
				printf("name=%s\n",s1.name);
				printf("math=%d\n",s1.math);
			}
		}
		else if(m==3)
		{
			break;
		}
	
	}
	stack_destroy(stack);
	return 0;

}
